package controller

import (
	"net/http"
	"server_cluster/common/logger"
	"server_cluster/http/model"

	"github.com/gin-gonic/gin"
)

func (c *Controller) userInfo(ctx *gin.Context) {

	userInfo, err := c.s.GetUserInfo()
	if err != nil {
		logger.Error("get user info error: %v", err)
		ctx.JSON(http.StatusOK, &model.CommonRsp{Code: 50000, Msg: err.Error()})
		return
	}
	ctx.JSON(http.StatusOK, &model.CommonRsp{Code: 20000, Data: userInfo})
}
